interface PayLoad {
    type: string
    payload: {
      [key: string]: any
    }
  }
  type IState = 'SHOW_ALL' | 'SHOW_COMPLETED' | 'SHOW_ACTIVE'

  const visibilityFilter = (state: IState = 'SHOW_ALL', action: PayLoad): IState => {
    switch (action.type) {
      case 'SET_VISIBILITY_FILTER':
        return action.payload.filter
      default:
        return state
    }
  }
  export default visibilityFilter
